Loading...
 

Backus-Naur Notation

Backus-Naur Notation

The Backus-Naur notation consists of production rules. Rules for complex constructs are based on rules for simpler elements of the language to be described. The rules are often recursive. On the left side is a meta variable. To the right of the '::=' sign it is explained how to create what is designated by the variable on the left side.

Either reference is made to simpler rules, or characters (sequences of characters) appear in exactly the same way - literally - in the generated text. Alternatives are separated by '|'. The description for something that can be omitted is put in square brackets.

In the example

fileName ::= name8[.extension]

fileName ::= name8 | name8.extension

both lines describe the same production rule. The dot . is a terminal symbol, while 'name8' and 'extension' are meta-variables that would still need to be defined by further rules.